﻿using System;
using System.Collections.Generic;
using System.Text;
using AutoShutdownDotNet.Models;
using System.Diagnostics;

namespace AutoShutdownDotNet.Actions
{
    public class DoAction
    {
        public AutoShutdownAction Action { get; set; }
        
        public DoAction(AutoShutdownAction action)
        {
            Action = action;
        }

        public string FilePath { get; set; }

        public void Do()
        {
            switch (Action)
            {
                case AutoShutdownAction.Logoff:
                    SystemActions.Logoff();
                    break;
                case AutoShutdownAction.Hibernate:
                    SystemActions.Hibernate();
                    break;
                case AutoShutdownAction.PowerOff:
                    SystemActions.PowerOff();
                    break;
                case AutoShutdownAction.Reboot:
                    SystemActions.Reboot();
                    break;
                case AutoShutdownAction.RunApplication:
                    SystemActions.Run(FilePath);
                    break;
                case AutoShutdownAction.Standby:
                    SystemActions.Standby();
                    break;
                case AutoShutdownAction.Lock:
                    SystemActions.Lock();
                    break;
                case AutoShutdownAction.ShowMessage:
                    break;
            }
        }



    }
}
